import request from '@/utils/request'
// 查询部门列表树结构
export function getTreeList() {
    return request({
        url: 'sjgtw-system/dept/treeselect',
        method: 'get'
    })
}
// 点击部门获取人员列表
export function getPersonBy(params) {
    return request({
        url: `/sjgtw-system/user/list`,
        method: 'get',
        params
    })
}
// 获取某部门的下一级部门列表
export function getDeptBy(params) {
    return request({
        url: `sjgtw-system/dept/treeselect`,
        method: 'get',
        params
    })
}

// 删除部门列表树结构
export function delTreeList(id) {
    return request({
        url: `/sjgtw-emergency/dept/delete/${id}`,
        method: 'delete'
    })
}
// 新增部门列表树结构
export function addTreeList(data) {
    return request({
        url: `/sjgtw-emergency/dept/add`,
        method: 'post',
        data
    })
}
// 修改部门列表树结构
export function editTreeList(data) {
    return request({
        url: `/sjgtw-emergency/dept/edit`,
        method: 'put',
        data
    })
}

// 获取应急人员管理列表
export function getPersonList() {
    return request({
        url: '/sjgtw-emergency/worker/list',
        method: 'get',
    })
}
// 新增应急人员管理列表
export function addPersonList(data) {
    return request({
        url: '/sjgtw-emergency/worker/add',
        method: 'post',
        data
    })
}


// 查询抢险突击队
export function getTeams() {
    return request({
        url: '/sjgtw-emergency/commandoUnits/list',
        method: 'get'
    })
}
// 删除抢险突击队
export function delTeams(id) {
    return request({
        url: `/sjgtw-emergency/commandoUnits/delete/${id}`,
        method: 'delete'
    })
}
// 新增抢险突击队
export function addTeams(data) {
    return request({
        url: `/sjgtw-emergency/commandoUnits/add`,
        method: 'post',
        data
    })
}
// 修改抢险突击队
export function editTeams(data) {
    return request({
        url: `/sjgtw-emergency/commandoUnits/edit`,
        method: 'put',
        data
    })
}

// 查询抢险队伍
export function getRescueTeam() {
    return request({
        url: '/sjgtw-emergency/rescueTeam/list',
        method: 'get'
    })
}
// 删除抢险队伍
export function delRescueTeam(id) {
    return request({
        url: `/sjgtw-emergency/rescueTeam/delete/${id}`,
        method: 'delete'
    })
}
// 新增抢险队伍
export function addRescueTeam(data) {
    return request({
        url: `/sjgtw-emergency/rescueTeam/add`,
        method: 'post',
        data
    })
}
// 修改抢险队伍
export function editRescueTeam(data) {
    return request({
        url: `/sjgtw-emergency/rescueTeam/edit`,
        method: 'put',
        data
    })
}

// 查询防洪网格化管理
export function getGrid(params) {
    return request({
        url: '/sjgtw-emergency/gridManage/list',
        method: 'get',
        params
    })
}
// 删除防洪网格化管理
export function delGrid(id) {
    return request({
        url: `/sjgtw-emergency/gridManage/delete/${id}`,
        method: 'delete'
    })
}
// 新增防洪网格化管理
export function addGrid(data) {
    return request({
        url: `/sjgtw-emergency/gridManage/add`,
        method: 'post',
        data
    })
}
// 修改防洪网格化管理
export function editGrid(data) {
    return request({
        url: `/sjgtw-emergency/gridManage/edit`,
        method: 'put',
        data
    })
}

// 查询防洪值班
export function getDuty() {
    return request({
        url: '/sjgtw-emergency/duty/list',
        method: 'get'
    })
}
// 删除防洪值班
export function delDuty(id) {
    return request({
        url: `/sjgtw-emergency/duty/delete/${id}`,
        method: 'delete'
    })
}
// 新增 + 修改 防洪值班
export function addDuty(data) {
    return request({
        url: '/sjgtw-emergency/duty/addOrEdit',
        method: 'post',
        data
    })
}
// 跟据人员获取值班日期
export function getDutyBy(params) {
    return request({
        url: '/sjgtw-emergency/duty/getUserDuty',
        method: 'get',
        params
    })
}


// 查询联防单位管理
export function getJoint(params) {
    return request({
        url: '/sjgtw-emergency/jointDefenceUnit/list',
        method: 'get',
        params
    })
}
// 删除联防单位管理
export function delJoint(id) {
    return request({
        url: `/sjgtw-emergency/jointDefenceUnit/${id}`,
        method: 'delete'
    })
}
// 新增联防单位管理
export function addJoint(data) {
    return request({
        url: `/sjgtw-emergency/jointDefenceUnit`,
        method: 'post',
        data
    })
}
// 修改联防单位管理
export function editJoint(data) {
    return request({
        url: `/sjgtw-emergency/jointDefenceUnit`,
        method: 'put',
        data
    })
}

// 上传
export function uploadFile(data) {
    return request({
        url: '/sjgtw-file/upload',
        method: 'post',
        data
    })
}

// 查询防洪重点地段管理
export function getControl(params) {
    return request({
        url: '/sjgtw-emergency/keysAreas/list',
        method: 'get',
        params
    })
}
// 删除防洪重点地段管理
export function delControl(id) {
    return request({
        url: `/sjgtw-emergency/keysAreas/delete/${id}`,
        method: 'delete'
    })
}
// 新增防洪重点地段管理
export function addControl(data) {
    return request({
        url: `/sjgtw-emergency/keysAreas/add`,
        method: 'post',
        data
    })
}
// 修改防洪重点地段管理
export function editControl(data) {
    return request({
        url: `/sjgtw-emergency/keysAreas/edit`,
        method: 'put',
        data
    })
}


// 查询应急演练管理
export function getDrill(params) {
    return request({
        url: '/sjgtw-emergency/drillPlan/list',
        method: 'get',
        params
    })
}
// 删除应急演练管理
export function delDrill(id) {
    return request({
        url: `/sjgtw-emergency/drillPlan/delete/${id}`,
        method: 'delete'
    })
}
// 新增应急演练管理
export function addDrill(data) {
    return request({
        url: `/sjgtw-emergency/drillPlan/add`,
        method: 'post',
        data
    })
}
// 修改应急演练管理
export function editDrill(data) {
    return request({
        url: `/sjgtw-emergency/drillPlan/edit`,
        method: 'put',
        data
    })
}

// 查询应急组织管理
export function getOrg(params) {
    return request({
        url: '/sjgtw-emergency/organization/list',
        method: 'get',
        params
    })
}
// 删除应急组织管理
export function delOrg(id) {
    return request({
        url: `/sjgtw-emergency/organization/delete/${id}`,
        method: 'delete'
    })
}
// 新增应急组织管理
export function addOrg(data) {
    return request({
        url: `/sjgtw-emergency/organization/add`,
        method: 'post',
        data
    })
}
// 保存应急组织管理
export function saveOrg(data) {
    return request({
        url: `/sjgtw-emergency/organization/addDetails`,
        method: 'post',
        data
    })
}

// 查询应急处置方案
export function getEmergency() {
    return request({
        url: '/sjgtw-emergency/freezeInjuryPlan/list',
        method: 'get'
    })
}
// 删除应急处置方案
export function delEmergency(id) {
    return request({
        url: `/sjgtw-emergency/freezeInjuryPlan/delete/${id}`,
        method: 'delete'
    })
}
// 新增应急组处置方案
export function addEmergency(data) {
    return request({
        url: `/sjgtw-emergency/freezeInjuryPlan/add`,
        method: 'post',
        data
    })
}
// 修改应急处置方案
export function editEmergency(data) {
    return request({
        url: `/sjgtw-emergency/freezeInjuryPlan/edit`,
        method: 'put',
        data
    })
}


// 查询重点地段处置
export function getAreas() {
    return request({
        url: '/sjgtw-emergency/siteDisposalPlan/list',
        method: 'get'
    })
}
// 删除重点地段处置
export function delAreas(id) {
    return request({
        url: `/sjgtw-emergency/siteDisposalPlan/delete/${id}`,
        method: 'delete'
    })
}
// 新增重点地段处置
export function addAreas(data) {
    return request({
        url: `/sjgtw-emergency/siteDisposalPlan/add`,
        method: 'post',
        data
    })
}
// 修改重点地段处置
export function editAreas(data) {
    return request({
        url: `/sjgtw-emergency/siteDisposalPlan/edit`,
        method: 'put',
        data
    })
}

// 查询防洪警示标志
export function getSign(params) {
    return request({
        url: '/sjgtw-emergency/warningSign/list',
        method: 'get',
        params
    })
}
// 删除防洪警示标志
export function delSign(id) {
    return request({
        url: `/sjgtw-emergency/warningSign/delete/${id}`,
        method: 'delete'
    })
}
// 新增防洪警示标志
export function addSign(data) {
    return request({
        url: `/sjgtw-emergency/warningSign/add`,
        method: 'post',
        data
    })
}
// 修改防洪警示标志
export function editSign(data) {
    return request({
        url: `/sjgtw-emergency/warningSign/edit`,
        method: 'put',
        data
    })
}


// 查询水库分布管理
export function getReservoir(params) {
    return request({
        url: '/sjgtw-emergency/reservoir/list',
        method: 'get',
        params
    })
}
// 删除水库分布管理
export function delReservoir(id) {
    return request({
        url: `/sjgtw-emergency/reservoir/delete/${id}`,
        method: 'delete'
    })
}
// 新增水库分布管理
export function addReservoir(data) {
    return request({
        url: `/sjgtw-emergency/reservoir/add`,
        method: 'post',
        data
    })
}
// 修改水库分布管理
export function editReservoir(data) {
    return request({
        url: `/sjgtw-emergency/reservoir/edit`,
        method: 'put',
        data
    })
}


// 查询雨量器管理
export function getGauge() {
    return request({
        url: '/sjgtw-emergency/rainfallGauge/list',
        method: 'get'
    })
}
// 删除雨量器管理
export function delGauge(id) {
    return request({
        url: `/sjgtw-emergency/rainfallGauge/delete/${id}`,
        method: 'delete'
    })
}
// 新增雨量器管理
export function addGauge(data) {
    return request({
        url: `/sjgtw-emergency/rainfallGauge/add`,
        method: 'post',
        data
    })
}
// 修改雨量器管理
export function editGauge(data) {
    return request({
        url: `/sjgtw-emergency/rainfallGauge/edit`,
        method: 'put',
        data
    })
}

// 雨量器类型查询
export function getGaugeType() {
    return request({
        url: "/sjgtw-system/dict/data/type/rainfall_gauge_type",
        method: 'get'
    })
}

// 查询雨量记录
export function getRain() {
    return request({
        url: '/sjgtw-emergency/rainfallMonitoring/list',
        method: 'get'
    })
}
// 删除雨量记录
export function delRain(id) {
    return request({
        url: `/sjgtw-emergency/rainfallMonitoring/delete/${id}`,
        method: 'delete'
    })
}
// 新增雨量记录
export function addRain(data) {
    return request({
        url: `/sjgtw-emergency/rainfallMonitoring/add`,
        method: 'post',
        data
    })
}
// 修改雨量记录
export function editRain(data) {
    return request({
        url: `/sjgtw-emergency/rainfallMonitoring/edit`,
        method: 'put',
        data
    })
}

// 修改雨量警戒值设置
export function editRange(data) {
    return request({
        url: `/sjgtw-emergency/rainfallRange/edit`,
        method: 'put',
        data
    })
}
// 查询雨量警戒值设置
export function getRange() {
    return request({
        url: '/sjgtw-emergency/rainfallRange/list',
        method: 'get'
    })
}


// 查询水害类型管理
export function getDamage() {
    return request({
        url: '/sjgtw-emergency/floodPlan/list',
        method: 'get'
    })
}
// 删除水害类型管理
export function delDamage(id) {
    return request({
        url: `/sjgtw-emergency/floodPlan/delete/${id}`,
        method: 'delete'
    })
}
// 新增水害类型管理
export function addDamage(data) {
    return request({
        url: `/sjgtw-emergency/floodPlan/add`,
        method: 'post',
        data
    })
}
// 修改水害类型管理
export function editDamage(data) {
    return request({
        url: `/sjgtw-emergency/floodPlan/edit`,
        method: 'put',
        data
    })
}
// 获取水害类型
export function getFlood() {
    return request({
        url: `sjgtw-system/dict/data/type/flood_type`,
        method: 'get'
    })
}

// WEb端---处置完成任一阶段的任务
export function getCompleted(params) {
    return request({
        url: `sjgtw-emergency/riskReporting/disposalCompleted`,
        method: 'get',
        params
    })
}
// Web端---点击“已下发”获取应急任务下发人员列表数据
export function getTaskUser(params) {
    return request({
        url: `sjgtw-emergency/riskReporting/getTaskDistributeUser`,
        method: 'get',
        params
    })
}
// Web端---下发应急任务/已下发但未在APP端确认的再次下发亦可以调用此接口
export function sendTask(data) {
    return request({
        url: `sjgtw-emergency/riskReporting/taskDistribute`,
        method: 'post',
        data
    })
}
//Web端---查询应急任务管理列表
export function getTaskList(params) {
    return request({
        url: `sjgtw-emergency/riskReporting/taskManagementList`,
        method: 'get',
        params
    })
}

// 专家库管理  新增
export function addExp(data) {
    return request({
        url: `sjgtw-emergency/expert/add`,
        method: 'post',
        data
    })
}
// 专家库管理  获取数据
export function getExp(params) {
    return request({
        url: `sjgtw-emergency/expert/list`,
        method: 'get',
        params
    })
}
// 专家库管理  修改专家库管理
export function editExp(data) {
    return request({
        url: `sjgtw-emergency/expert/edit`,
        method: 'put',
        data
    })
}
// 删除水害类型管理
export function delExp(id) {
    return request({
        url: `/sjgtw-emergency/expert/delete/${id}`,
        method: 'delete'
    })
}
// 专家库管理  获取类型管理数据
export function getExpType() {
    return request({
        url: `sjgtw-emergency/expert/getExpertTypeList`,
        method: 'get',
    })
}
// 专家库管理  删除类型管理数据
export function delExpType(params) {
    return request({
        url: `sjgtw-emergency/expert/deleteExpertType`,
        method: 'get',
        params
    })
}
// 专家库管理  新增类型管理数据
export function addExpType(data) {
    return request({
        url: `sjgtw-emergency/expert/addExpertType`,
        method: 'post',
        data
    })
}



export function getDept(params) {
    return request({
        url: `sjgtw-system/dept/` + params  ,
        method: 'get'
    })
}

// 删除冻害记录
export function delfreeze(id) {
    return request({
        url: `/sjgtw-emergency/freeze/delete/${id}`,
        method: 'get'
    })
}
// 删除路堑护坡
export function delSlope(id) {
    return request({
        url: `/sjgtw-emergency/cuttingSlopeProtection/delete/${id}`,
        method: 'get'
    })
}
// 删除防洪设备检查
export function delCheck(id) {
    return request({
        url: `/sjgtw-emergency/equipmentCheck/delete/${id}`,
        method: 'get'
    })
}